/*
 *  Date.h
 *  Calendar
 *
 *  Created by Fredrik Gustafsson on 9/27/10.
 *  Copyright 2010 Kungliga Tekniska Högskolan. All rights reserved.
 *
 */

#ifndef LAB2_DATE_H_
#define LAB2_DATE_H_
#include <iostream>
#include <string>

namespace lab2 {
	class Date {
	public:
		explicit Date();
//		virtual ~Date();
		virtual const int year() const =0;
		virtual const int month() const =0;
		virtual const int day() const =0;
		virtual const int week_day() const =0;
		virtual const int days_per_week() const =0;
		virtual const int days_this_month() const =0;
		virtual const int months_per_year() const =0;
		virtual const std::string week_day_name() const =0;
		virtual const std::string month_name() const =0;
		virtual const int mod_julian_day() const =0;
		
		Date& operator++();
		Date& operator--();
		
		Date& operator+=(const int);
		Date& operator-=(const int);
		
		virtual Date& add_year(const int) =0;
		virtual Date& add_month(const int) =0;
		virtual Date& add_year() =0;
		virtual Date& add_month() =0;
		Date& operator=(const Date&);
		bool operator==(const Date&) const;
		bool operator!=(const Date&) const;
		bool operator<(const Date&) const;
		bool operator<=(const Date&) const;
		bool operator>(const Date&) const;
		bool operator>=(const Date&) const;
		int operator-(const Date&) const;
		virtual void print(std::ostream&) const =0;
		
		friend std::ostream& operator<<(std::ostream& os, const Date& d) {
			d.print(os);
			return os;
		}
	protected:
		virtual void set_date_from_base(int base) =0;
	};
}

#endif
